package com.app.allwe.task;

import com.app.allwe.gui.FrameService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component("taskJob")
public class TaskManager {

    @Value("${timed_task_expression}")
    private String cron;

    @Resource
    private FrameService frameService;

    // 30 分钟执行一次
    @Scheduled(cron = "0 0,30 * * * ? ")
    public void taskRemindDrink() throws InterruptedException {
        frameService.createBaseFrame();
    }

}
